<ng-template #uploadList>
    <el-upload-list [files]="files" *ngIf="showFileList" [list-type]="listType" [disabled]="disabled"
        (remove)="removeHandle($event)" (preview)="lifecycle.preview($event)"> 
    </el-upload-list>
</ng-template>
<ng-template #triggerBlock>
    <div [class]="'el-upload el-upload--' + listType" (click)="clickHandle()">
        <el-button *ngIf="!trigger" size="small" type="primary">立即上传</el-button>
        <ng-container *ngIf="trigger">
            <ng-template [ngTemplateOutlet]="trigger"></ng-template>
        </ng-container> 
        <input class="el-upload__input" type="file" name="file" #input [accept]="accept" [name]="name"
            [multiple]="multiple" (change)="changeHandle($event)">
    </div>
</ng-template>
<el-upload-dragger *ngIf="drag" [disabled]="disabled" (change)="changeHandle($event)">
    <ng-template [ngTemplateOutlet]="triggerBlock"></ng-template>
</el-upload-dragger>
<ng-container *ngIf="listType === 'picture-card'">
    <ng-template [ngTemplateOutlet]="uploadList"></ng-template>
</ng-container>
<ng-container *ngIf="!drag">
    <ng-template [ngTemplateOutlet]="triggerBlock"></ng-template>
</ng-container>
<ng-container *ngIf="tip">
    <ng-template [ngTemplateOutlet]="tip"></ng-template>
</ng-container>
<ng-container *ngIf="listType !== 'picture-card'">
    <ng-template [ngTemplateOutlet]="uploadList"></ng-template>
</ng-container>